import request from "@/utils/request";
export interface Role {
    _id: string;
    title: string;
    description: string;
    status: number;
}
export interface RoleAccess {
    role_id: string;
    access_id: string;
}
export const getRoleApi = () => request.get("/admin/role");
export const createRoleApi = (roleInfo: Partial<Role>) => request.post("/admin/role", roleInfo);
export const updateRoleApi = (roleInfo: Partial<Role>) => request.patch("/admin/role", roleInfo);
export const deleteRoleApi = (roleInfo: Partial<Role>) => request.delete("/admin/role", { data: roleInfo });
export const getRoleAccessApi = (role_id: RoleAccess["role_id"]) => request.get("/admin/role/auth", { params: { role_id } });
export const createRoleAccessApi = (query: { role_id: RoleAccess["access_id"]; access_ids: RoleAccess["access_id"][] }) =>
    request.post("/admin/role/auth", query);

// const one: (arg: boolean) => number = () => {};
// const add = (arg:any)=>{
//     return arg;
// }
// const two = (arg:any)=>{

// }
// one(add(two()) === two(add(one()))) === 3;